package com.nsfocus.network;

import com.sun.org.apache.xerces.internal.dom.PSVIAttrNSImpl;

import java.net.URL;

/**
 * @File: Url.java
 * @User: Liangkangkang
 * @Date: 17-4-25
 * @Time: 上午11:09
 * @Mail: liangkangkang@yahoo.com
 * @Desc:
 * @Version:
 */

public class Url {
    public static void main(String[] args) throws  Exception{
        String addr = "http://192.168.1.143:8080/home/lkk/1.jpg";
        URL  url = new URL(addr);
        System.out.println(url.getPort());
        System.out.println(url.getHost());
        System.out.println(url.getProtocol());
        System.out.println(url.getPath());
    }
}
